#!/usr/bin/env python

import socket

host = '' #bind to all interfaces
port = 51426

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((host,port))
s.listen(1)

print "Server is running on port %d; press Ctrl-C to terminate." % port

while 1:
  clientsock, clientaddr = s.accept()
  print "got connection from", clientsock.getpeername()
  clientsock.close()
